using System;
using System.IO;
using System.IO.IsolatedStorage;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input.Touch;


using BlueGameComponent;

namespace TouchExplode
{
    class HelpScreen : MenuScreen
    {
        Texture2D bg;

        public HelpScreen()
            : base("")
        {
            IsPopup = true;
            EnabledGestures = GestureType.Tap;
            Game1.AdMgr.SetVisible(false);
        }

        public override void LoadContent()
        {
            bg = ScreenManager.Game.Content.Load<Texture2D>("Textures/help");
        }

        public override void HandleInput(InputState input)
        {
            base.HandleInput(input);
            if (input == null)
            {
                throw new ArgumentNullException("input");
            }

            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
            {
                this.ExitScreen();
            }

            if (!IsActive)
            {
                return;
            }

            // Return to the main menu when a tap gesture is recognized
            if (input.Gestures.Count > 0)
            {
                GestureSample sample = input.Gestures[0];
                if (sample.GestureType == GestureType.Tap)
                {
                    this.ExitScreen();

                    input.Gestures.Clear();
                }
            }
        }

        public override void Draw(GameTime gameTime)
        {
            SpriteBatch spriteBatch = ScreenManager.SpriteBatch;

            spriteBatch.Begin();
            DrawTransition(bg, new Vector2(0, 0), Color.White);
            
            
            spriteBatch.End();

            base.Draw(gameTime);

        }

    }
}
